package com.group.three.controller.order;

import com.group.three.entity.Receipt;
import com.group.three.service.AfterSaleService;
import com.group.three.service.ReceiptService;
import com.group.three.vo.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 店铺端,发票接口
 **/
@RestController
@Api(tags = "店铺端,发票接口")
@RequestMapping("/store/trade/receipt")
public class ReceiptStoreController {
    @Autowired
    private ReceiptService receiptService;

    @ApiOperation(value = "通过id获取")
    @ApiImplicitParam(name = "id", value = "店铺ID/发票ID", required = true, dataType = "String", paramType = "path")
    @GetMapping(value = "/get/{id}")
    public JsonResult get(@PathVariable String id,int pageNum,int pageSize) {
     List<Receipt> receipts= receiptService.judgment(id,pageNum,pageSize);
        if (receipts !=null){
            return new JsonResult("200","发票列表查询成功",receipts);
        }
        return new JsonResult("400","发票列表查询失败");
    }
}
